package com.xpsoft.oa.dao.produce.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.produce.ProjectWorkPlanInfoDao;
import com.xpsoft.oa.model.produce.ProjectWorkPlanInfo;

public class ProjectWorkPlanInfoDaoImpl extends BaseDaoImpl<ProjectWorkPlanInfo> implements ProjectWorkPlanInfoDao{

	public ProjectWorkPlanInfoDaoImpl() {
		super(ProjectWorkPlanInfo.class);
	}

	@Override
	public void deleteProjectWorkPlanInfos(Long planId, List<Long> idList) {
		// TODO Auto-generated method stub
		String hql = "delete from ProjectWorkPlanInfo where id not in (:ids) and projectWorkPlan.id=:planId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("planId", planId);
		query.executeUpdate();
	}

}